extends ../layout

block content
  .container
    .row
      each cat in categories
        .panel.panel-default
          .panel-heading
            h3
              a(href='/nodeport/results?cat=#{cat._id}&p=0') #{cat.name}
          .panel-body
            if cat.movies && cat.movies.length > 0
              each item in cat.movies
                .col-md-2
                  .thumbnail
                    a(href="/nodeport/movie/#{item._id}")
                      if item.poster.indexOf('http') > -1
                        img(src="#{item.poster}", alt="#{item.title}")
                      else
                        img(src="/nodeport/upload/#{item.poster}", alt="#{item.title}")
                    .caption
                      h4 #{item.title}
                      p: a.btn.btn-primary(href="/nodeport/movie/#{item._id}", role="button") 观看预告片